package mall.dao;

import mall.pojo.Memberposition;

import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class MemberPositionDAOImpl implements MemberPositionDAO {

	@Autowired
	private SessionFactory sessionFactory;
	
	@Override
	public Memberposition getMemberPosition(int positionId) {
		String hql="FROM Memberposition MP WHERE MP.id ="+positionId;
		Query query=sessionFactory.getCurrentSession().createQuery(hql);
		return (Memberposition)query.list().get(0);
	}

}
